.toc-container {
  position: sticky;
  top: 84px;
  padding: 0 20px;
  overflow: auto;
  max-height: calc(100vh - 84px);
  word-break: break-word;
  scrollbar-width: none !important;
  &::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none;
  }
  // 解决重复点击目录层级链接的问题
  & .can-unfold > a.is-active {
    pointer-events: none;
  }
  a {
    display: inline-block;
    color: inherit;
    line-height: 17px;
    &:hover {
      color: #FF6407;
    }
    &.is-active {
      color: #FF6407;
      font-weight: 500;
    }
    &::selection {
      background-color: transparent;
      color: inherit;
    }
  }
  & .folded {
    & > ul {
      display: none;
    }
  }
  & ul.top {
    color: #191A1B;
    > li {
      position: relative;
      font-weight: 500;
      box-sizing: border-box;
      &.has-no-subject {
        padding: 10px 0 10px 12px;
      }
      &.can-unfold {
        padding: 10px 10px 10px 12px;
        cursor: pointer;
        & > ul {
          margin-top: 10px;
          margin-bottom: -10px;
          border-top: 1px solid #EBEEF5;
          & > li {
            color: #303133;
            & > ul {
              position: relative;
              &:before {
                position: absolute;
                content: '';
                width: 4px;
                height: 100%;
                background: #F5EFEB;
                left: -12px;
                top: 0;
              }
            }
          }
        }
        &:after {
          content: "";
          position: absolute;
          top: 16px;
          right: 0px;
          width: 10px;
          height: 10px;
          background: url(../images/icons/solid-arrow.png) no-repeat;
          background-size: contain;
          transform: rotate(90deg);
          transform-origin: 6px 3px;
          transition: transform 0.3s ease-out;
        }
        &:before {
          content: '';
          position: absolute;
          width: calc(100% - 24px);
          bottom: 0;
          left: 12px;
          height: 1px;
          background-color: #EBEEF5;
        }
      }
      &.folded {
        border-color: transparent;
        &:after {
          transform: rotate(0deg);
        }
        &:before {
          background-color: transparent;
        }
      }
    }
  }
  & ul:not(.top) {
    & li {
      font-weight: 400;
      font-size: 12px;
      & > a {
        padding: 8px 0;
      }
      &.can-unfold {
        padding: 8px 0;
        color: #303133;
        position: relative;
        cursor: pointer;
        font-weight: 500;
        padding-left: 12px;
        & > a {
          padding: 0;
        }
        & .small-folded-icon {
          background-image: url(../images/icons/minus.png);
        }
        & > ul {
          color: #606266;
          margin-top: 8px;
          margin-bottom: -8px;
        }
      }
      &.folded {
        & .small-folded-icon {
          background-image: url(../images/icons/plus.png);
        }
      }
    }
    & .small-folded-icon {
      position: absolute;
      top: 12px;
      left: 0;
      width: 10px;
      height: 10px;
      background-repeat: no-repeat;
      background-size: contain;
      transition: all .3s;
    }
  }
}

@media screen and (max-width: 750px){
  .toc-container {
    background: #f7f8f9;
    padding: 0px 24px 0 0;
    margin-bottom: 20px;
    & ul.top > li {
      padding: 10px 24px !important;
      &.has-no-subject {
        & a {
          line-height: 22px;
        }
      }
    }
    &.show {
      display: none;
    }
  }
}